<?php

$validationCreerSortie = "

	<script type='text/javascript'>

		function validationCreerSortie(thisForm)
		{
                    
			var isValid = true;
			if( !(document.getElementById('destRadio1').checked||document.getElementById('destRadio2').checked) )
			{
				isValid = false;
				$('#ttl1').attr('style','background-color:grey;');
			}else{
				$('#ttl1').attr('style','');
			}
                        
			if( $('#titreSortie').val()==''  || $('#typeSortie').val()=='')
			{
				isValid = false;
				$('#titreCnt').attr('style','background-color:grey;');
			}else{
				$('#titreCnt').attr('style','');
			}
                     if( $('#dateSortie').val()=='' )
			{
				isValid = false;
				$('#dateCnt').attr('style','background-color:grey;');
			}else{
				$('#dateCnt').attr('style','');
			}
                     if($('#heureDebutSortie').val().substr(0,1)=='H' || $('#heureFinSortie').val().substr(0,1)=='H')
                     {
                            isValid = false;
				$('#heureCnt').attr('style','background-color:grey;');
                     }else{
                            $('#heureCnt').attr('style','');
                     }
			if( $('#sortieDescription').val()=='' )
			{
				isValid = false;
				$('#descriptionCnt').attr('style','background-color:grey;');
			}else{
				$('#descriptionCnt').attr('style','');
			}
			if( $('#lieu').val()=='' )
			{
				isValid = false;
				$('#lieuCnt').attr('style','background-color:grey;');
			}else{
				$('#lieuCnt').attr('style','');
			}
                       
			if( $('#localite').val()=='' )
			{
				isValid = false;
				$('#adresseCnt').attr('style','background-color:grey;');
			}else{
				$('#adresseCnt').attr('style','');
			}
                     
			// envoi du formulaire si ok
			if(isValid)
			{
				thisForm.submit();
			}
		}
	
	</script>

";


?>
